package com.enation.app.javashop.api.client;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.enation.app.javashop.mapper.member.MemberWalletMapper;
import com.enation.app.javashop.model.member.dos.MemberWalletDO;
import com.enation.app.javashop.model.member.vo.GoodsGrade;
import com.enation.app.javashop.model.security.ScanModuleDTO;
import com.enation.app.javashop.model.security.ScanResult;
import com.enation.app.javashop.model.trade.order.dto.OrderDetailDTO;
import com.enation.app.javashop.service.member.MemberCommentManager;
import com.enation.app.javashop.service.member.MemberWalletManager;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

import java.util.List;

/**
 * @author zs
 * @version v2.0
 * @Description: 会员预存款对外client
 * @date 2021-12-21
 * @since v7.2.3
 */
@RestController
@RequestMapping("/client/members/member-wallet")
@Validated
@ApiIgnore
public class MemberWalletClientController {

    @Autowired
    private MemberWalletManager memberWalletManager;

    @GetMapping(value = "/{member_id}")
    public MemberWalletDO getByMemberId(@PathVariable("member_id") Long memberId) {
        return memberWalletManager.getByMemberId(memberId);
    }

    @GetMapping
    public void reSign(){
        memberWalletManager.reSign();
    }

    @RequestMapping(value = "/repair/{wallet_id}", method = RequestMethod.GET)
    public void repair(@PathVariable("wallet_id")Long memberWalletId){
        memberWalletManager.repair(memberWalletId);
    }

    @RequestMapping(value = "/scan-module", method = RequestMethod.POST)
    public ScanResult scanModule(@RequestBody ScanModuleDTO scanModuleDTO) {
        return this.memberWalletManager.scanModule(scanModuleDTO);
    }
}
